# Contributor: Fernando Casas Schossow <casasfernando@outlook.com>
# Maintainer: Fernando Casas Schossow <casasfernando@outlook.com>
pkgname=ocaml-calendar
pkgver=2.03.2
pkgrel=1
pkgdesc="Objective Caml library for managing dates and times"
url="http://calendar.forge.ocamlcore.org/"
arch="aarch64 ppc64le x86_64" # restrict by ocaml
license="LGPL-2.1-or-later-WITH-linking-exception"
makedepends="ocaml ocaml-findlib-dev ocaml-ocamldoc gawk"
subpackages="$pkgname-dev $pkgname-doc"
source="http://forge.ocamlcore.org/frs/download.php/915/calendar-2.03.2.tar.gz"
builddir="$srcdir/calendar-$pkgver"

build() {
	cd "$builddir"
	./configure --prefix=/usr --libdir=/usr/lib
	make
}

check() {
	cd "$builddir"
	make tests
}

package() {
	cd "$builddir"
	export DESTDIR="$pkgdir"
	export OCAMLFIND_DESTDIR="$DESTDIR/usr/lib/ocaml"
	mkdir -p "$OCAMLFIND_DESTDIR"
	make install
	install -D -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
	install -D -m644 LGPL "$pkgdir/usr/share/licenses/$pkgname/LGPL"
	install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="c6acc326aaed77d238126f8723a8e3e4054808ddfef974d9aead39731f4ab9f386eff2f34aab17e4eade3825dd1e3b708a404ecde3fc9b82416482c7095de82b  calendar-2.03.2.tar.gz"
